<template>
  <el-main class="basic-config">
    <div class="basic-config-title sa-flex">
      <div class="title-tx"></div>
      <div class="title-text">
        <div class="title-name sa-flex">
          鲸囍生活
          <img src="./img/shop.png" alt="">
        </div>
        <el-rate
          v-model="state.data.rate"
          disabled
          show-score
          text-color="#ff9900"
          score-template="{value}">
        </el-rate>
      </div>
    </div>
    <div class="basic-body sa-m-t-18">
      <div class="body-text sa-p-t-16">
        <div class="body-item sa-flex" @click="copyShopId">
          <div class="item-it">商家ID</div>
          <div class="item-right">19745211</div>
          <img src="./img/copy.png" alt="">
        </div>
        <div class="body-item sa-flex">
          <div class="item-it">公司名称</div>
          <div class="item-right">鲸囍生活</div>
          <!-- <div class="item-btn">修改</div> -->
        </div>
        <div class="body-item sa-flex">
          <div class="item-it">店铺名称</div>
          <div class="item-right">鲸囍生活</div>
          <!-- <div class="item-btn">修改</div> -->
        </div>
      </div>
      <div class="body-text sa-p-t-10">
        <div class="body-item sa-flex">
          <div class="item-it">开店时间</div>
          <div class="item-right">19745211</div>
        </div>
        <div class="body-item sa-flex">
          <div class="item-it">所在地区</div>

          <div class="item-right">浙江省杭州市</div>
        </div>
        <div class="body-item sa-flex">
          <div class="item-it">我的类目</div>
          <div class="item-right">休闲玩乐</div>
          <div class="item-btn" @click="routerGo('/seller/admin/info/category')">修改</div>
        </div>
      </div>
    </div>
    <div class="basic-bottom sa-m-t-25">
      <div class="bottom-flex sa-flex">
        <div class="bottom-item"></div>
        <el-button class="bottom-text" type="text" @click="routerGo('/seller/admin/info/shop')">修改店铺信息</el-button>
      </div>
      <div class="bottom-flex sa-flex">
        <div class="bottom-item"></div>
        <el-button class="bottom-text" type="text" @click="routerGo('/seller/admin/info/contact')">修改联系人</el-button>
      </div>
      <div class="bottom-flex sa-flex">
        <div class="bottom-item"></div>
        <el-button class="bottom-text" type="text" @click="routerGo('/seller/admin/info/accountnumber')">修改账号信息</el-button>
      </div>
      <div class="bottom-flex sa-flex">
        <div class="bottom-item"></div>
        <el-button class="bottom-text" type="text" @click="routerGo('/seller/admin/info/money')">资金管理</el-button>
      </div>
    </div>
  </el-main>
</template>

<script setup>
  import { reactive, onMounted } from 'vue';
  import {api} from '../info.service'
  import { checkUrl } from '@/sheep/utils/checkUrlSuffix';
  import {useRouter} from 'vue-router';

  const router = useRouter();

  const state = reactive({
    data: {},
  });

  onMounted(() => {
    getData();
  });

  const getData = async () => {
    let {error,data} = await api.basic.info()
    console.log('data',data)
    if (error === 0) {
      data.rate = '5.0'
      state.data = data
    }
  };
  const copyShopId = async () => {
    try {
      await navigator.clipboard.writeText('19745211');
    } catch (error) {
      console.error('复制失败:', error);
    }
  };
  function routerGo(data) {
    router.push({
      path: data,
      query: {
        type: 'edit',
        id:data.id
      },
    });
  }
</script>

<style lang="scss" scoped>
.basic-config{
   background-color: #EBECF8 !important;
  .basic-config-title{
    font-variation-settings: "opsz" auto;
    font-feature-settings: "kern" on;
    color: #202020;
    font-family: Source Han Sans;
    font-size: 20px;
    font-weight: bold;
    .title-tx{
      width: 60px;
      height: 60px;
      background-color: #D8D8D8;
      border-radius: 50%;
    }
    .title-text{
      height: 60px;
      margin-left: 10px;
      .title-name{
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        img{
          width: 38px;
          height: 27px;
          margin-left: 8px;
        }
      }
    }
  }
  .basic-body{
    width: 1561px;
    height: 84px;
    border-radius: 20px;
    padding: 0px 25px;
    background: linear-gradient(180deg, #F1F4FE 0%, #FFFFFF 100%);
    .body-text{
      justify-content: space-between;
      display: flex;
      .body-item{
        width: 33.3%;
        font-family: Source Han Sans;
        font-size: 14px;
        font-weight: normal;
        line-height: normal;
        font-variation-settings: "opsz" auto;
        font-feature-settings: "kern" on;
        color: #080808;
        align-items: center;
        .item-it{
          width: 56px;
        }
        .item-right{
          margin-left: 13px;
        }
        img{
          height: 11px;
          width: 10px;
          margin-left: 13px;
        }
        .item-btn{
          font-family: Source Han Sans;
          font-size: 14px;
          font-weight: normal;
          font-variation-settings: "opsz" auto;
          font-feature-settings: "kern" on;
          color: #3868FA;
          margin-left: 3px;
        }
      }
    }
  }
  .basic-bottom{
    display: flex;
    width: 1561px;
    height: 74px;
    border-radius: 20px;
    padding: 16px 32px;
    padding-bottom: 10px;
    background: linear-gradient(93deg, #F1F4FE 0%, #FFFFFF 51%);
    justify-content: space-between;
    .bottom-flex{
      width: 25%;
      display: flex;
      .bottom-item{
        width: 47px;
        height: 48px;
        background: #5E87F1;
        border-radius: 50%;
      }
      .bottom-text{
        font-family: Source Han Sans;
        font-size: 16px;
        font-weight: normal;
        font-variation-settings: "opsz" auto;
        font-feature-settings: "kern" on;
        color: #080808;
        margin-left: 11px;
      }
    }
  }
}



.el-rate{
      --el-rate-icon-margin: 1px;
}
// .el-rate .el-rate__icon{
//   margin-right: 3px !important;
// }
</style>
